#include "mainwindow.h"
#include "ui_mainwindow.h"
#include"dialog.h"
#include"QFileDialog"
#include"QDebug"
#include"QFontDialog"
#include"QFont"
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    Dialog* dig= new Dialog();
    dig->setAttribute(Qt::WA_DeleteOnClose);

    dig->show();
}

void MainWindow::on_pushButton_2_clicked()
{
    QString path=QFileDialog::getOpenFileName();//获取文件路径
    QString path2=QFileDialog::getSaveFileName();//保存文件并且获取路径
    qDebug()<<path2;

}



void MainWindow::on_pushButton_3_clicked()
{   bool status=false;//判断是否使用对话框
    QFont font=QFontDialog::getFont(&status);
    ui->pushButton_3->setFont(font);
    qDebug()<<status;
    qDebug()<<font;
}
